From 3746e6806c6c67a32a09ebbb7c1c1b6c85f4921e Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Fri, 9 Apr 2004 04:53:52 +0000 Subject: [PATCH] Include the meta-robots, meta-keywords, and link-RSS tags, and the set MIME type, in MonoBook output. --- includes/OutputPage.php | 35 +++++++++++++++++++++-------------- includes/SkinPHPTal.php | 6 ++++-- templates/xhtml_slim.pt | 4 ++-- 3 files changed, 27 insertions(+), 18 deletions(-) diff --git a/includes/OutputPage.php b/includes/OutputPage.php index f42c9f870d..ff75cbcf5e 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -602,6 +602,27 @@ class OutputPage { $ret .= "\n"; $ret .= "\n{$this->mHTMLtitle}\n"; array_push( $this->mMetatags, array( "http:Content-type", "$wgMimeType; charset={$wgOutputEncoding}" ) ); + $ret .= $this->getHeadLinks(); + global $wgStyleSheetPath; + if( $this->isPrintable() ) { + $media = ""; + } else { + $media = "media='print'"; + } + $printsheet = htmlspecialchars( "$wgStyleSheetPath/wikiprintable.css" ); + $ret .= "\n"; + + $sk = $wgUser->getSkin(); + $ret .= $sk->getHeadScripts(); + $ret .= $sk->getUserStyles(); + + $ret .= "\n"; + return $ret; + } + + function getHeadLinks() { + global $wgRequest; + $ret = ""; foreach ( $this->mMetatags as $tag ) { if ( 0 == strcasecmp( "http:", substr( $tag[0], 0, 5 ) ) ) { $a = "http-equiv"; @@ -631,20 +652,6 @@ class OutputPage { $link = $wgRequest->escapeAppendQuery( "feed=rss" ); $ret .= "\n"; } - global $wgStyleSheetPath; - if( $this->isPrintable() ) { - $media = ""; - } else { - $media = "media='print'"; - } - $printsheet = htmlspecialchars( "$wgStyleSheetPath/wikiprintable.css" ); - $ret .= "\n"; - - $sk = $wgUser->getSkin(); - $ret .= $sk->getHeadScripts(); - $ret .= $sk->getUserStyles(); - - $ret .= "\n"; return $ret; } } diff --git a/includes/SkinPHPTal.php b/includes/SkinPHPTal.php index d1ab8d4692..605bdd48ad 100644 --- a/includes/SkinPHPTal.php +++ b/includes/SkinPHPTal.php @@ -62,7 +62,7 @@ function outputPage( &$out ) { global $wgTitle, $wgArticle, $wgUser, $wgLang, $wgOut; global $wgScriptPath, $wgStyleSheetPath, $wgLanguageCode, $wgUseNewInterlanguage; - global $wgOutputEncoding, $wgUseDatabaseMessages, $wgRequest; + global $wgMimeType, $wgOutputEncoding, $wgUseDatabaseMessages, $wgRequest; $this->thispage = $wgTitle->getPrefixedDbKey(); $this->loggedin = $wgUser->getID() != 0; @@ -81,7 +81,9 @@ $tpl->setRef( "title", &$this->titletxt ); // ? $tpl->setRef( "thispage", &$this->thispage ); $tpl->set( "subtitle", $out->getSubtitle() ); - $tpl->setRef( 'charset', $wgOutputEncoding); + $tpl->setRef( 'mimetype', $wgMimeType ); + $tpl->setRef( 'charset', $wgOutputEncoding ); + $tpl->set( 'headlinks', $out->getHeadLinks() ); $tpl->setRef( 'skinname', $this->skinname ); $tpl->setRef( "loggedin", &$this->loggedin ); /* XXX currently unused, might get useful later diff --git a/templates/xhtml_slim.pt b/templates/xhtml_slim.pt index fe96764253..1bc23e6673 100644 --- a/templates/xhtml_slim.pt +++ b/templates/xhtml_slim.pt @@ -2,8 +2,8 @@ - - + + ${headlinks} Exciting xhtml slimfast